<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body ng-app="myApp" ng-controller="myController">
	<input type="text" ng-model="name">
	<!-- <input type="text" ng-model="getAge()"> -->
	<input type="text" ng-model="age">
	<script src="angular.js"></script>
	<script>
		var app =angular.module("myApp",[]);
		app.controller("myController",["$scope",function($scope){
				$scope.name="xiaoming";
				$scope.age=19;
				$scope.getAge=function(){
					return $scope.age;
				};
				$scope.$watch("getAge()",function(now,old){
					console.log(now,old);
				});
		}]);
	</script>
</body>
</html>
